@echo   ===========================================================================                                                                   
@echo    _                                   _           _______  ______   ______  
@echo   (_)                                 (_)         (_______)(_____ \ (_____ \ 
@echo    _        _____   ____  ___   ____   _   ____    _____    _____) ) _____) )
@echo   ^| ^|      (____ ^| / ___)/ _ \ ^|  _ \ ^| ^| / ___)  ^|  ___)  ^|  __  / ^|  ____/ 
@echo   ^| ^|_____ / ___ ^|( (___^| ^|_^| ^|^| ^| ^| ^|^| ^|( (___   ^| ^|_____ ^| ^|  \ \ ^| ^|      
@echo   ^|_______)\_____^| \____)\___/ ^|_^| ^|_^|^|_^| \____)  ^|_______)^|_^|   ^|_^|^|_^|                                   
@echo   ===========================================================================     
@echo   ============================================ ver. VERSION_TAG module update =
@echo   ===========================================================================  
@echo   =                              Please wait...                             =
@echo   ===========================================================================  
@echo off

call :progress 0

@echo Create tomcat folder.
md %CATALINA_HOME%\webapps\laconic\img
md %CATALINA_HOME%\webapps\laconic\inc
md %CATALINA_HOME%\webapps\laconic\css
md %CATALINA_HOME%\webapps\laconic\open-iconic
md %CATALINA_HOME%\webapps\laconic\jsp
md %CATALINA_HOME%\webapps\laconic\js
md %CATALINA_HOME%\webapps\laconic\jasper
md %CATALINA_HOME%\webapps\laconic\downloads
md %CATALINA_HOME%\webapps\laconic\WEB-INF
@echo off

call :progress 13

For /f "tokens=1-4 delims=/- " %%a in ('date /t') do (set mydate=%%a_%%b%%c)
For /f "tokens=1-2 delims=/: " %%a in ("%TIME%") do (set mytime=%%a%%b)
@echo %mydate%_%mytime%_tomcat >> %CATALINA_HOME%\webapps\laconic\VERSION_TAG_update.txt

@echo Over write patch file.
xcopy common\. %CATALINA_HOME%\common\ /E/Y
@echo off
call :progress 15
xcopy img\. %CATALINA_HOME%\webapps\laconic\img /E/Y
@echo off
call :progress 18
xcopy inc\. %CATALINA_HOME%\webapps\laconic\inc /E/Y
@echo off
call :progress 25
xcopy css\. %CATALINA_HOME%\webapps\laconic\css /E/Y
@echo off
call :progress 26
xcopy css\. %CATALINA_HOME%\webapps\laconic\open-iconic /E/Y
@echo off
call :progress 28
xcopy jsp\. %CATALINA_HOME%\webapps\laconic\jsp /E/Y
@echo off
call :progress 50
xcopy js\. %CATALINA_HOME%\webapps\laconic\js /E/Y
@echo off
call :progress 55
xcopy jasper\. %CATALINA_HOME%\webapps\laconic\jasper /E/Y
@echo off
call :progress 60
xcopy downloads\. %CATALINA_HOME%\webapps\laconic\downloads /E/Y
@echo off
call :progress 70
xcopy WEB-INF\. %CATALINA_HOME%\webapps\laconic\WEB-INF /E/Y
@echo off
call :progress 100

@echo   ===========================================================================                                                                   
@echo    _                                   _           _______  ______   ______  
@echo   (_)                                 (_)         (_______)(_____ \ (_____ \ 
@echo    _        _____   ____  ___   ____   _   ____    _____    _____) ) _____) )
@echo   ^| ^|      (____ ^| / ___)/ _ \ ^|  _ \ ^| ^| / ___)  ^|  ___)  ^|  __  / ^|  ____/ 
@echo   ^| ^|_____ / ___ ^|( (___^| ^|_^| ^|^| ^| ^| ^|^| ^|( (___   ^| ^|_____ ^| ^|  \ \ ^| ^|      
@echo   ^|_______)\_____^| \____)\___/ ^|_^| ^|_^|^|_^| \____)  ^|_______)^|_^|   ^|_^|^|_^|                                   
@echo   ===========================================================================                                        
@echo   =========================================================================== 
@echo   =     Thank you for choosing Laconic, the best ERP provider in SE Asia!   =
@echo   =========================================================================== 
@echo   ========================== Press any key to exit... =======================
@echo   =========================================================================== 

pause


:progress
SETLOCAL ENABLEDELAYEDEXPANSION
SET ProgressPercent=%1
SET /A NumBars=%ProgressPercent%/2
SET /A NumSpaces=50-%NumBars%
SET Meter=
FOR /L %%A IN (%NumBars%,-1,1) DO SET Meter=!Meter!I
FOR /L %%A IN (%NumSpaces%,-1,1) DO SET Meter=!Meter! 
TITLE Progress:  [%Meter%]  %ProgressPercent%%%
ENDLOCAL
